<template>
  <div class="page Mine">
    
    <h1 v-if="loginDate">
      <Mineinfo/>
      <Button type="default" @click="clear" ghost>注销</Button>
    </h1>
    
    <Login v-else @transfer="loginget"/>
    <Play/>
  </div>
</template>
<script>
// @ is an alias to /src
import Login from '../../components/Login'
import Mineinfo from '../../components/Mine-info'
import Play from '../../components/playone'

export default {
  name: "Mine",
  components: {
   Login,
   Mineinfo,
   Play
    
  },
  data(){
    return{
      // 这个用于修改登录状态
      loginDate:false
    }
  },
  methods:{
    clear(){
    this.$axios
        .get(this.$URL.BASE_URL + "/logout")
        .then(res => {
          console.log(res);
          if(res.status==200){
            console.log(this.loginDate);
            this.loginDate=false
          }
        })
        .catch(err => {
          console.log(err.message);
        });
    },
    loginget(meg){
      this.loginDate=meg
    }
  }
  
};
</script>